package com.tij.rtti.typeinfo;

import com.sun.org.apache.xml.internal.security.Init;

import java.util.Random;

/**
 * @ClassName:
 * @author:
 * @Description: TODO
 * data:2024/10/6 19:50
 * @since
 **/
class Initable{
    static final int staticFinal = 47;
    static final int staticFinal2 = ClassInitialization.rand.nextInt(1000);
    static final int staticFinal3= ClassInitialization.rand.nextInt(1000);

    static{
        System.out.println("Initializing Initable ----1 ");
    }
}

class Initable2{
    static int staticNonFinal = 147;
    static {
        System.out.println("Initializing Initable ----2 ");
    }
}

class Initable3{
    static int staticNonFinal = 74;
    static {
        System.out.println("Initializing Initable ----3 ");
    }
}
public class ClassInitialization {
    public static Random rand = new Random(47);
    public static void main(String[] args){
        Class initable = Initable.class;
        System.out.println("After creating Initable ref....");

        System.out.println(Initable.staticFinal);
        System.out.println(Initable.staticFinal2);
        System.out.println(Initable.staticFinal3);
        System.out.println(Initable.staticFinal3);

        System.out.println(Initable2.staticNonFinal);
        System.out.println(Initable3.staticNonFinal);

    }
}
